package serverContinent;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ServletDemo04 extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("调用了ServletDemo04");
        System.out.println(req.getRequestURI());
        String path = req.getRequestURI();
        if ("/hikari".equals(path)) {
            System.out.println("做我大老婆。");
        } else if ("/mimi".equals(path)) {
            System.out.println("也做我老婆。");
        } else if ("/sora".equals(path)) {
            System.out.println("也是我老婆。");
        }

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
